﻿using System;
using System.Net;
using System.ComponentModel;
using caedisi.Web.DataModel;


namespace caedisi.Models
{
    public class RuleValidationError : INotifyPropertyChanged
    {
        private TransitionRule _Item1;
        /// <summary>
        /// Gets or sets the item1.
        /// </summary>
        /// <value>
        /// The item1.
        /// </value>
        public TransitionRule Item1
        {
            get
            {
                return _Item1;
            }
            set
            {
                if (_Item1 != value)
                {
                    _Item1 = value;
                    this.RaisePropertyChanged("Item1");                   
                }
            }
        }

        private TransitionRule _Item2;
        /// <summary>
        /// Gets or sets the item2.
        /// </summary>
        /// <value>
        /// The item2.
        /// </value>
        public TransitionRule Item2
        {
            get
            {
                return _Item2;
            }
            set
            {
                if (_Item2 != value)
                {
                    _Item2 = value;
                    this.RaisePropertyChanged("Item2");
                }
            }
        }

        /// <summary>
        /// Initializes a new instance of the <see cref="RuleValidationError"/> class.
        /// </summary>
        /// <param name="rule1">The rule1.</param>
        /// <param name="rule2">The rule2.</param>
        public RuleValidationError(TransitionRule rule1, TransitionRule rule2)
        { 
            this.Item1 = rule1;
            this.Item2 = rule2;
            
        }


        #region INotifyPropertyChanged

        public event PropertyChangedEventHandler PropertyChanged;
        /// <summary>
        /// Raises the property changed.
        /// </summary>
        /// <param name="propertyName">Name of the property.</param>
        protected virtual void RaisePropertyChanged(string propertyName)
        {
            PropertyChangedEventHandler handler = this.PropertyChanged;
            if (handler != null)
            {
                handler(this, new PropertyChangedEventArgs(propertyName));
            }
        }

        #endregion
    }
}
